package com.bjpowernode.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bjpowernode.model.Result;
import com.bjpowernode.domain.Comments;
import com.bjpowernode.service.CommentsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api("房屋评价接口")
public class CommentController {

    @Resource
    private CommentsService commentsService;

    @GetMapping("comment")
    @ApiOperation("根据房子id分页获取房间评价")
    public Result<Page<Comments>> getCommentsByHouseId(Integer id, Integer page){
        Page<Comments> commentsByPage = commentsService.findCommentsByPage(id, page);
        return Result.success("ok",commentsByPage);
    }
}
